<link type="text/css" rel="stylesheet" href="{url:#css/ucenter.css}"/>
{echo:JS::import('form');}
{echo:JS::import('date');}
{echo:JS::import('dialog?skin=tinysimple');}
<script type="text/javascript" charset="UTF-8" src="{url:#js/jquery.iframe-post-form.js}"></script>
<div class="container clearfix">
    {widget:name=sub_navs action=ucsidebar sidebar=$sidebar act=$actionId}
    <div class="uc-content clearfix">
        <h1 class="title"><span>激活列表：</span></h1>
        {if:isset($msg)}
        <div class="message_{$msg[0]} ie6png">{$msg[1]}</div>
        {elseif:isset($validator)}
        <div class="message_warning ie6png">{$validator['msg']}</div>
        {/if}
        <div class="mt10 tab">
            <span style="margin-left: 300px;font-size: 16px;font-weight: 800">现金分余额: ({$obj['xjf']})</span>&nbsp;&nbsp;&nbsp;&nbsp;
            <span style="font-size: 16px; font-weight: 800">注册分余额: ({$obj['zcf']})</span>
            <ul class="tab-head">
                <li>未激活列表<i></i></li>
                <li>激活列表<i></i></li>
            </ul>
            <div class="tab-body">
                <!-- 一级密码 -->
                <!--<div>-->
                    <!--<form id="proxy-form" class="simple" action="{url:/ucenter/applyForAgent}" method="post" enctype="multipart/form-data">-->
                        <!--<table class="form">-->
                            <!--<tr>-->
                                <!--<td class="label">代理类别：</td>-->
                                <!--<td width="240">-->
                                    <!--<select pattern="required" name="agent" id="proxy-type" alt="请选择类别" style="width:180px;height: 30px;">-->
                                        <!--<option value="">请选择代理类别</option>-->
                                        <!--<option value="1">创客中心</option>-->
                                        <!--<option value="2">社区服务站</option>-->
                                        <!--<option value="3">县级运营商</option>-->
                                        <!--<option value="4">市级运营商</option>-->
                                        <!--<option value="5">省级运营商</option>-->
                                    <!--</select>-->
                                    <!--<label></label>-->
                                <!--</td>-->
                            <!--</tr>-->
                            <!--<tr>-->
                                <!--<td class="label">所在地区：</td>-->
                                <!--<td id="area">-->
                                    <!--<select id="province" name="province">-->
                                        <!--<option value="0">==省份/直辖市==</option>-->
                                    <!--</select>-->
                                    <!--<select id="city" name="city">-->
                                        <!--<option value="0">==市==</option>-->
                                    <!--</select>-->
                                    <!--<select id="county" name="county">-->
                                        <!--<option value="0">==县/区==</option>-->
                                    <!--</select>-->
                                    <!--&lt;!&ndash;<input pattern="^\d+,\d+,\d+$" id="test" type="text" style="visibility:hidden;width:0;"&ndash;&gt;-->
                                    <!--&lt;!&ndash;value="{$province},{$city},{$county}" alt="请选择完整地区信息！">&ndash;&gt;-->
                                    <!--<label></label>-->
                                <!--</td>-->
                            <!--</tr>-->
                            <!--<tr>-->
                                <!--<td class="label">支付凭证：</td>-->
                                <!--<td width="500">-->
                                    <!--<input name="proof-path" id="proof-path" type="file">-->
                                    <!--&lt;!&ndash;<span id="proof-path" pattern="required" alt="请上传支付凭证"></span>&ndash;&gt;-->
                                <!--</td>-->
                            <!--</tr>-->
                            <!--<tr>-->
                                <!--<td colspan="2" class="tc"><input type="submit" class="btn" value="确认申请"></td>-->
                            <!--</tr>-->
                        <!--</table>-->
                        <!--{token:}-->
                    <!--</form>-->
                <!--</div>-->

                <table class="simple address-list mt20">
                    <tr>
                        <th>帐号</th>
                        <th>推荐人</th>
                        <th>状态</th>
                        <th>投资级别</th>
                        <th>代理地域</th>
                        <th>注册时间</th>
                        <th width="150px">激活方式</th>
                        <th width="200px">操作</th>
                    </tr>
                    {list:items=$ok_obj}
                    <tr class="{if:$key%2==1}odd{else:}even{/if}">
                        <td width="80px" style="text-align:center">{$item['name']}</td>
                        <td width="100px" style="text-align:center">{echo:Common::get_tjr_name($item['tjr_id'])['name']}</td>
                        <td width="200px" style="text-align:center">{if:$item['status']==0}未激活{elseif:$item['status']==1}激活{/if}</td>
                        <td width="150px" >
                            {if:$item['group_id'] == 0}
                            无
                            {elseif:$item['group_id'] == 1}
                            一级代理
                            {elseif:$item['group_id'] == 2}
                            二级代理
                            {elseif:$item['group_id'] == 3}
                            县代理
                            {elseif:$item['group_id'] == 4}
                            市代理
                            {/if}
                        </td>
                        <td width="150px" style="text-align:center">{echo:Common::area_name($item['dl_area'])}</td>
                        <td width="250px" style="text-align:center">{$item['reg_time']}</td>
                        <form action="{url:/ucenter/active}" method="post">
                            <input type="hidden" value="{$item[id]}" name="uid" id="uid">
                            <input type="hidden" value="{$item[group_id]}" name="agent" id="agent">
                            <input type="hidden" value="{$item[dl_area]}" name="dl_area" id="dl_area">
                            <td style="text-align:center">
                                <select name="method" id="method" style="width:200px">
                                    <option value="1">100%现金分激活({echo:Common::get_lx_money($item['group_id'])})</option>
                                    <option value="2">80%现金分({echo:Common::get_lx_money($item['group_id'])*0.8})+20%注册分激活({echo:Common::get_lx_money($item['group_id'])*0.2})</option>
                                </select>
                            </td>
                            <td colspan="2" class="tc" width="250px">
                                <input type="submit" class="btn btn-main btn-mini" value="激活" onclick="return confirm('确定要执行此操作?');">
                                <a href="{url:/ucenter/del_user/id/$item[id]}" id="zz-btn" class="btn btn-main btn-mini" onclick="return confirm('确定要执行此操作?');">删除</a>
                            </td>

                        </form>
                    </tr>
                    {/list}

                </table>


                <table class="simple address-list mt20">
                    <tr>
                        <th>帐号</th>
                        <th>推荐人</th>
                        <th>状态</th>
                        <th>投资级别</th>
                        <th>代理地域</th>
                        <th width="300px">激活时间</th>
                    </tr>
                    {list:items=$no_obj}
                    <tr class="{if:$key%2==1}odd{else:}even{/if}">
                        <td width="80px" style="text-align:center">{$item['name']}</td>
                        <td width="100px" style="text-align:center">{echo:Common::get_tjr_name($item['tjr_id'])['name']}</td>
                        <td width="200px" style="text-align:center">{if:$item['status']==0}未激活{elseif:$item['status']==1}激活{/if}</td>
                        <td width="100px" >
                            {if:$item['group_id'] == 0}
                            无
                            {elseif:$item['group_id'] == 1}
                            一级代理
                            {elseif:$item['group_id'] == 2}
                            二级代理
                            {elseif:$item['group_id'] == 3}
                            县代理
                            {elseif:$item['group_id'] == 4}
                            市代理
                            {/if}
                        </td>
                        <td width="100px" style="text-align:center">{echo:Common::area_name($item['dl_area'])}</td>
                        <td width="250px" style="text-align:center">{$item['jh_time']}</td>
                    </tr>
                    {/list}
                </table>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">

    $('#proxy-type').change(function(){
        $('#province').removeAttr('disabled');
        $('#city').removeAttr('disabled');
        $('#county').removeAttr('disabled');
        var agent =  $(this).val();
        if(agent == 1){
            $('#province').attr('disabled',true).val(0);
            $('#city').attr('disabled',true).val(0);
            $('#county').attr('disabled',true).val(0);
        } else if(agent == 4) {
            $('#county').attr('disabled',true).val(0);
        } else if(agent == 5) {
            $('#city').attr('disabled',true).val(0);
            $('#county').attr('disabled',true).val(0);
        }
    });


    $("#areas").Linkage({ url:"{url:/ajax/area_data}",selected:[{$province|0},{$city|0},{$county|0}],callback:function(data){
        var text = new Array();
        var value = new Array();
        for(i in data[0]){
            if(data[0][i]!=0){
                text.push(data[1][i]);
                value.push(data[0][i]);
            }
        }
        $("#test").val(value.join(','));
        FireEvent(document.getElementById("test"),"change");
    }});
    {if:isset($invalid)}
    autoValidate.showMsg({id:$("input[name='{$invalid['name']}']").get(0),error:true,msg:'{$invalid['msg']}'});
    {/if}
</script>
<script type="text/javascript">

</script>